<include file="Public/header" />
    <div class="comm-top">
    	<include file="Customer/nav" act_nav="add"/>
        <h4 style="margin-bottom:0">添加员工</h4>
        <div class="add_page_top"></div>
    </div>
    <form id="dataForm" onsubmit="return false;">
        <input type="hidden" name="info[id]" value="{$formData.id}"/>
        <input type="hidden" name="info[type]" value="2"/>
        <div class="shop_sort_box">
            <div class="shop_sort">
                <div class="shop_sort_title"><h4><must>*</must>员工昵称：</h4></div>
                <div class="shop_sort_set">
                    <input class="shop_sort_text" name="info[nickname]" value="{$formData.nickname}" type="text" placeholder="请输入员工昵称" />
                </div>
            </div>
            <if condition="$formData['id'] eq ''">
            <div class="shop_sort">
                <div class="shop_sort_title"><h4><must>*</must>账号名：</h4></div>
                <div class="shop_sort_set">
                    <input class="shop_sort_text" name="info[username]" value="" type="text" placeholder="3-10位字母、数字、下划线组合" />
                </div>
            </div>
            <div class="shop_sort">
                <div class="shop_sort_title"><h4><must>*</must>密码：</h4></div>
                <div class="shop_sort_set">
                    <input class="shop_sort_text" name="info[password]" value="" type="password" placeholder="3-10位字母、数字组合" />
                </div>
            </div>
            </if>
            <div class="shop_sort">
                <div class="shop_sort_title"><h4>状态：</h4></div>
                <div class="shop_sort_set rdo">
                    <label class="lbl"><span><input type="radio" name="info[status]" {:$formData['status']!='2'?'checked':''} value='1'></span><span>开放</span></label>
                    <label class="lbl"><span><input type="radio" name="info[status]" {:$formData['status']=='2'?'checked':''} value='2'></span><span>关闭</span></label>
                </div>
            </div>
            <div class="shop_sort">
                <div class="shop_sort_title">
                    <h4>&nbsp;</h4>
                </div>
                <div class="shop_sort_set">
                    <span onclick="save(this);return false" id="saveBtn" class="btngreen30">完成</span>
                    &nbsp;&nbsp;&nbsp;
                    <span onclick="history.go(-1);" class="btngray30">返回</span>
                </div>
            </div>
        </div>
    </form>
<script>
function save(obj){
    $.post('{:U("add")}',$('#dataForm').serialize(),function(res){
        if(res.status == 1){
            note_info(res.info,obj);
            setTimeout('location.href="'+data.url+'"',1200);
        }else{
            note_info(res.info,obj,'warn');
        }
    },'json')
}
</script>
<include file="Public/footer" />